package com.itheima;

public class Demo2 {
    //    将一个数组的元素倒叙排列,
    public static void main(String[] args) {
        int[] arr = {12, 35, 66, 44, 98, 77, 99, 665};
        int left = 0;
        int right = arr.length - 1;
        for (; left < right; left++, right--) {
            int A= arr[left];
            arr[left]=arr[right];
            arr[right]=A;
        }

//        while

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
